fix(move-compiler): prevent panic on assert! with wrong arg count#25471
Open
lau90eth wants to merge 1 commit intoMystenLabs:mainfrom
Open
fix(move-compiler): prevent panic on assert! with wrong arg count#25471lau90eth wants to merge 1 commit intoMystenLabs:mainfrom
lau90eth wants to merge 1 commit intoMystenLabs:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
a74a184 to
0246125
Compare
|
Deployment failed with the following error: |
Fixes MystenLabs#25459 Fixes MystenLabs#25453 This PR fixes two compiler panics in hlir/translate.rs caused by improper use of .unwrap() on operations that can fail. Fix 1: assert! argument count (Issue MystenLabs#25459) - Replace unwrap() with match when converting arg list to fixed-size array - Now shows error instead of panic when assert! has wrong arg count Fix 2: PackVariant field lookup (Issue MystenLabs#25453) - Replace map().unwrap() with filter_map() + match - Now shows error instead of panic when enum variant has invalid fields Both fixes provide graceful error messages instead of crashing.
866d927 to
d401020
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[move-compiler] Fix compiler panics: assert! args and PackVariant fields
Fixes
unwrap()onassert!with wrong number of arguments #25459 - Compiler panic on assert! with wrong arg countunwrap()onNoneinPackVariantfield lookup #25453 - Compiler panic on malformed PackVariant field lookupSummary
This PR fixes two compiler panics in
hlir/translate.rscaused by improper use of.unwrap()on operations that can fail. Both fixes replaceunwrap()with proper error handling to provide graceful error messages instead of crashing.Fix 1: assert! Argument Count (Issue #25459)
Problem: The compiler panicked with
called Result::unwrap() on an Err valuewhenassert!was called with more than 2 arguments.Root Cause: In
hlir/translate.rs, the code used.unwrap()when converting the argument list to a fixed-size array[T; 2]: